package cn.usian.controller;

import cn.usian.common.R;
import cn.usian.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

@RestController
@RequestMapping("order")
public class OrdersController {
    @Autowired
    private OrdersService ordersService;

    @GetMapping("page")
    public R findPage(Integer page, Integer pageSize, String number, LocalDateTime beginTime,LocalDateTime endTime){
        return ordersService.findPage(page,pageSize,number,beginTime,endTime);
    }

    @PutMapping
    public R send(Long id,Integer status){
        return ordersService.send(id,status);
    }
}
